#region License Revision: 0 Last Revised: 6/18/2008 11:00 AM
/******************************************************************************
Copyright (c) Microsoft Corporation.  All rights reserved.


This file is licensed under the Microsoft Public License (Ms-PL). A copy of the Ms-PL should accompany this file. 
If it does not, you can obtain a copy from: 

http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.mspx
******************************************************************************/
#endregion // License
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace VIEWS
{
    /// <summary>
    /// Provides data for the <see cref="VEMap.FindCompleted">FindCompleted</see> event.
    /// </summary>
    public class FindCompletedEventArgs : EventArgs
    {
        private string error;
        private VEShapeLayer layer;
        private bool moreResults;
        private VEPlace[] places;
        private VEFindResult[] results;

        /// <summary>
        /// Initializes a new <see cref="FindCompletedEventArgs"/> instance.
        /// </summary>
        /// <param name="layer">The layer that the route shapes are on.</param>
        /// <param name="results">The results of find operation.</param>
        /// <param name="places">The list of potential places included in the result.</param>
        /// <param name="moreResults"><c>true</c> if more results are available; otherwise <c>false</c>.</param>
        /// <param name="error">The error message, if one ocurred.</param>
        public FindCompletedEventArgs(VEShapeLayer layer, VEFindResult[] results, VEPlace[] places, bool moreResults, string error)
        {
            this.layer = layer;
            this.results = results;
            this.places = places;
            this.moreResults = moreResults;
            this.error = error;
        }

        /// <summary>
        /// Gets the error message, if one ocurred.
        /// </summary>
        /// <value>
        /// The error message, if one ocurred.
        /// </value>
        public object Error
        {
            get
            {
                return error;
            }
        }


        /// <summary>
        /// Gets the layer that the route shapes are on.
        /// </summary>
        /// <value>
        /// The layer that the route shapes are on.
        /// </value>
        /// <remarks>
        /// This member is only valid if a layer was specified in the initial request.
        /// </remarks>
        public VEShapeLayer Layer
        {
            get
            {
                return layer;
            }
        }

        /// <summary>
        /// Gets a value that indicates if more results are available.
        /// </summary>
        /// <value>
        /// <c>true</c> if more results are available; otherwise <c>false</c>.
        /// </value>
        public bool MoreResults
        {
            get
            {
                return moreResults;
            }
        }

        /// <summary>
        /// Gets the list of potential places included in the result.
        /// </summary>
        /// <value>
        /// The list of potential places included in the result.
        /// </value>
        public VEPlace[] Places
        {
            get
            {
                return places;
            }
        }

        /// <summary>
        /// Gets results of the find operation.
        /// </summary>
        /// <value>
        /// The results of find operation.
        /// </value>
        public VEFindResult[] Results
        {
            get
            {
                return results;
            }
        }
    }
}
